package com.yazi.mxz.person.jackson.filter;

import java.util.HashSet;
import java.util.Set;

import com.fasterxml.jackson.databind.ser.FilterProvider;
import com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter;
import com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider;
import com.yazi.mxz.common.entity.beans.Member;
import com.yazi.mxz.common.entity.beans.MemberPrepaid;

public abstract class MemberPrepaidFilter {

	public static FilterProvider getWithMemberByCheckerId() {
		final Set<String> prepaid = new HashSet<String>();
		prepaid.add("account");
		prepaid.add("addTime");
		prepaid.add("balance");
		prepaid.add("given");
		prepaid.add("memberByCheckerId");
		prepaid.add("prepaid");
		prepaid.add("prepaidId");
		prepaid.add("promote");
		prepaid.add("type");
		final Set<String> memberByCheckerId = new HashSet<String>();
		memberByCheckerId.add("balance");
		memberByCheckerId.add("integral");
		memberByCheckerId.add("memberId");
		memberByCheckerId.add("mobile");
		memberByCheckerId.add("name");
		memberByCheckerId.add("realName");

		return new SimpleFilterProvider()
				.addFilter(MemberPrepaid.class.getSimpleName(),
						SimpleBeanPropertyFilter.filterOutAllExcept(prepaid))
				.addFilter(Member.class.getSimpleName(),
						SimpleBeanPropertyFilter.filterOutAllExcept(memberByCheckerId));
	}

}
